<!DOCTYPE html>
<html>

{include file='public/header'}
<style>
    .layui-inline{
        margin-bottom: 10px;
    }
</style>
<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">回传</a>
            <a><cite>已回传数据</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">链接ID：</label>
                    <div class="layui-input-inline" >
                        <input type="text" name="link_id" placeholder="请输入链接ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">计划ID：</label>
                    <div class="layui-input-inline" >
                        <input type="text" name="advertiser_id" placeholder="请输入计划ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">用户ID：</label>
                    <div class="layui-input-inline" >
                        <input type="text" name="uid" placeholder="请输入用户ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto" >选择媒体：</label>
                    <div id="pMenu" ></div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">回传状态：</label>
                    <div class="layui-input-inline" >
                        <select name="status" id="status">
                            <option value="0"></option>
                            <option value="1">成功</option>
                            <option value="2">失败</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">是否首单：</label>
                    <div class="layui-input-inline" >
                        <select name="is_first_recharge" id="is_first_recharge">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">回传时间：</label>
                    <div class="layui-inline" id="time" style="display: flex;align-items: center;">
                        <div class="layui-input-inline" style="margin-right:10px; width: 130px">
                            <input type="text" autocomplete="off" name="start_date" id="start_date" class="layui-input"
                                placeholder="开始日期">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style='width: 130px'>
                            <input type="text" autocomplete="off" name="end_date" id="end_date" class="layui-input"
                                placeholder="结束日期">
                        </div>
                    </div>
                </div>
                
                <div class="layui-inline">
                    <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                    <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </form>
        </div>
        <table id="alreadyEchoList" lay-filter="alreadyEchoList"></table>
    </div>
    <script>
        let params = {
            elem: '#alreadyEchoList'
            , toolbar: '#toolbarDemo'
            , url: '/cps/back/alreadyEchoList' //数据接口
            , id: 'alreadyEchoList'
            , limit:15
            , page:true
            , cols: [[ //表头
                { field: 'id', title: 'ID' ,sort: true,width:80,align:'center' }
                , { field: 'link_id', title: '链接ID',width:80, align:'center'}
                , { field: 'advertiser_id', title: '计划ID',width:180, align:'center'}
                , { field: 'pay_id', title: '支付ID', align:'center'}
                
                , { field: 'uid', title: '用户ID', align:'center'}
                , { field: 'activation_time', title: '激活时间', align:'center', width:160}
                // , { field: 'register_time', title: '注册时间', align:'center', width:160}
                , { field: 'order_no', title: '订单', align:'center', width:172}
                , { field: 'media_id', title:'媒体',templet: function (d) {
                        let type = ''
                        switch (d.media_id) {
                            case 1:
                                type = '抖音'
                                break;
                            case 2:
                                type = '快手'
                                break;
                            case 3:
                                type = '百度'
                                break;
                            case 4:
                                type = '腾讯'
                                break;
                            case 5:
                                type = '公众号H5'
                                break;
                            case 6:
                                type = '短信H5'
                                break;
                            case 7:
                                type = '企业微信'
                                break;
                            default:
                                type = '内推'
                        }
                        return type
                    } , align:'center'
                }
                , { title: '回传状态',width:90, templet: function (d) {
                        return d.status == 1 ? '成功' : '失败'
                    }, align:'center'
                }
                , { title: '是否首单',width:90 , templet: function (d) {
                        return d.is_first_recharge == 1 ? '是' : '否'
                    }, align:'center'
                }
                , { field: 'echo_rule_config_id', title:'回传规则',templet: function (d) {
                        let type = ''
                        switch (d.echo_rule_config_id) {
                            case 0:
                                type = '按公共配置回传'
                                break;
                            case 1:
                                type = '按自然日回传'
                                break;
                            case 2:
                                type = '仅回传首单'
                                break;
                            default:
                                type = '手动回传'
                        }
                        return type
                    } , align:'center', width:130
                }
                // , { field: 'message', title:'回传提示',width:86, align:'center'}
                , { field: 'pay_price', title:'支付金额',width:86, align:'center'}
                , { field: 'created_at', title: '回传时间', templet: function (d) {
                        return dayjsFormat(d.created_at)
                    }, align:'center', width:170
                }
            ]]
        }
        tableList(params)
        let selectParams = {
            url: '/cps/link/getLaunchMedia',
            selected: [],
            tips: '选择媒体',
            name: 'media_id',
            field_id: 'id',
            field_Name: 'name',
            elem: '#pMenu'
        }
        selectN(selectParams)
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            //日期范围
            laydate.render({
                elem: '#time'
                , range: ['#start_date', '#end_date']
                ,format: 'yyyy-MM-dd',
            });
        })
    </script>
</body>

</html>